<?php
/**
 * 过滤请求参数
 */

namespace backend\filter;


use common\utils\CommonUtil;
use yii\base\ActionFilter;

class RequestFilter extends ActionFilter
{

    public function beforeAction($action)
    {
        if (count($_GET)) {
            CommonUtil::enSlashesData($_GET);
        }
        if (count($_POST)) {
            CommonUtil::enSlashesData($_POST);
        }
        if (count($_COOKIE)) {
            CommonUtil::enSlashesData($_COOKIE);
        }
        return true;
    }
}